package com.aliyun.heiyu.powermaster.server.dao.impl;

import com.aliyun.heiyu.common.util.JdbcUtil;
import com.aliyun.heiyu.powermaster.server.dao.DeviceAirDao;
import com.aliyun.heiyu.powermaster.server.obj.po.NewestAirPO;


public class DeviceAirDaoImpl implements DeviceAirDao {

    /** 获取最新的空调的温度上限和温度下限 */
    public NewestAirPO selectNewestAir(){
        String sql =" select  a.device_id deviceId,b.air_set_temperature_upper_limit upperLimit,b.air_set_temperature_lower_limit lowerLimit from  device_common a " +
                    " left join device_air b on b.device_id=a.device_id" +
                    " where  a.type ='air' and a.status = 1  order by a.modified_time desc  limit 1";
        return JdbcUtil.queryForBean(sql, null, NewestAirPO.class);
    }
}
